# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 152
n 152(None)[return None
]:
	i: 66(), 92()
	o: 

nname: 66
n 66(None)[log.error('Cannot open mouse')
del self.mouse
]:
	i: 0(except)
	o: 152()

nname: 92
n 92(None)[self.kbmap_get = DIRECTFB_MAP.get
self.setDaemon(True)
self.setName('MousePlugin')
Task(self.start).start(1.0)
]:
	i: 19(), 91(AE)
	o: 152()

nname: 19
n 19(None)[self.mouse = Mouse()
self._last_event = None
self._last_ts = 0
log.info('Mouse created')
]:
	i: 0(try)
	o: 92()

nname: 0
n 0(None)[threading.Thread.__init__(self)
]:
	i: 
	o: 19(try), 66(except)

nname: 152
n 152(None)[return None
]:
	i: 66()
	o: 

nname: 66
n 66(None)[except:
	log.error('Cannot open mouse')
	del self.mouse
else:
	self.kbmap_get = DIRECTFB_MAP.get
	self.setDaemon(True)
	self.setName('MousePlugin')
	Task(self.start).start(1.0)
]:
	i: 0()
	o: 152()

nname: 0
n 0(None)[threading.Thread.__init__(self)
try:
	self.mouse = Mouse()
	self._last_event = None
	self._last_ts = 0
	log.info('Mouse created')
]:
	i: 
	o: 66()

nname: 152
n 152(None)[return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[threading.Thread.__init__(self)
try:
	self.mouse = Mouse()
	self._last_event = None
	self._last_ts = 0
	log.info('Mouse created')
except:
	log.error('Cannot open mouse')
	del self.mouse
else:
	self.kbmap_get = DIRECTFB_MAP.get
	self.setDaemon(True)
	self.setName('MousePlugin')
	Task(self.start).start(1.0)
]:
	i: 
	o: 152()

nname: 0
n 0(None)[threading.Thread.__init__(self)
try:
	self.mouse = Mouse()
	self._last_event = None
	self._last_ts = 0
	log.info('Mouse created')
except:
	log.error('Cannot open mouse')
	del self.mouse
else:
	self.kbmap_get = DIRECTFB_MAP.get
	self.setDaemon(True)
	self.setName('MousePlugin')
	Task(self.start).start(1.0)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ffcac>}
nname: 554
n 554(None)[return None
]:
	i: 0(AL), 552()
	o: 

nname: 552
n 552(None)[]:
	i: 16(f), 549()
	o: 554()

nname: 549
n 549(None)[]:
	i: 547(AE)
	o: 552()

nname: 547
n 547(None)[]:
	i: 512(f), 522()
	o: 549(AE)

nname: 522
n 522(None)[#, e
log.error('Error while calling Mouse.get(): %s', e)
continue
]:
	i: 512(t)
	o: 547()

nname: 512
n 512(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 22(except), 508()
	o: 522(t), 547(f)

nname: 508
n 508(None)[continue
]:
	i: 483(JA), 504(), 507()
	o: 512()

nname: 507
n 507(None)[]:
	i: 26(f)
	o: 508()

nname: 504
n 504(None)[]:
	i: 420(JA), 503()
	o: 508()

nname: 503
n 503(None)[]:
	i: 363(f)
	o: 504()

nname: 483
n 483(None)[log.debug('DROP %s', event)
]:
	i: 369&385&401(f)
	o: 508(JA)

nname: 420
n 420(None)[ts = time() + 0.20000000000000001
event.post(dict(count=1, timeout=ts))
self._last_event = event
self._last_ts = ts
]:
	i: 369&385&401(t)
	o: 504(JA)

nname: 369&385&401
n 369&385&401(self._last_event is None or event != self._last_event or time() > self._last_ts)[]:
	i: 363(t)
	o: 420(t), 483(f)

nname: 363
n 363(event)[]:
	i: 208(JA), 260(), 279(), 311(), 343(), 362()
	o: 369&385&401(t), 503(f)

nname: 362
n 362(None)[]:
	i: 330(f)
	o: 363()

nname: 343
n 343(None)[event = self.kbmap_get('SMALL_H')
]:
	i: 330(t)
	o: 363()

nname: 330
n 330(self.mouse.bm)[]:
	i: 298(f)
	o: 343(t), 362(f)

nname: 311
n 311(None)[event = self.kbmap_get('SMALL_A')
]:
	i: 298(t)
	o: 363()

nname: 298
n 298(self.mouse.br)[]:
	i: 266(f)
	o: 311(t), 330(f)

nname: 279
n 279(None)[event = self.kbmap_get('ENTER')
]:
	i: 266(t)
	o: 363()

nname: 266
n 266(self.mouse.bl)[]:
	i: 41&124(f)
	o: 279(t), 298(f)

nname: 260
n 260(None)[event = self.kbmap_get('CURSOR_DOWN')
]:
	i: 231(), 247()
	o: 363()

nname: 247
n 247(None)[]:
	i: 214(f)
	o: 260()

nname: 231
n 231(None)[]:
	i: 214(t)
	o: 260()

nname: 214
n 214(vec[1] > 0)[]:
	i: 141(f)
	o: 231(t), 247(f)

nname: 208
n 208(None)[event = self.kbmap_get('CURSOR_LEFT')
]:
	i: 179(), 195()
	o: 363(JA)

nname: 195
n 195(None)[]:
	i: 162(f)
	o: 208()

nname: 179
n 179(None)[]:
	i: 162(t)
	o: 208()

nname: 162
n 162(vec[0] > 0)[]:
	i: 141(t)
	o: 179(t), 195(f)

nname: 141
n 141(abs_vec[0] > abs_vec[1])[]:
	i: 41&124(t)
	o: 162(t), 214(f)

nname: 41&124
n 41&124(abs_vec[0] > threshold or abs_vec[1] > threshold)[log.debug(self.mouse)
vec = self.mouse.lastvector
abs_vec = (abs(vec[0]), abs(vec[1]))
event = None
]:
	i: 26(t)
	o: 141(t), 266(f)

nname: 26
n 26(self.mouse.get())[]:
	i: 22(try)
	o: 41&124(t), 507(f)

nname: 22
n 22(None)[]:
	i: 16(t)
	o: 26(try), 512(except)

nname: 16
n 16(True)[]:
	i: 0(loop)
	o: 22(t), 552(f)

nname: 0
n 0(None)[log.debug('start')
]:
	i: 
	o: 16(loop), 554(AL)

nname: 554
n 554(None)[return None
]:
	i: 0(AL), 16(f), 512(AE)
	o: 

nname: 512
n 512(None)[except Exception, e:
	log.error('Error while calling Mouse.get(): %s', e)
	continue
]:
	i: 508(), 22()
	o: 554(AE)

nname: 508
n 508(None)[continue
]:
	i: 483(JA), 420(JA), 363(f), 22(f)
	o: 512()

nname: 483
n 483(None)[log.debug('DROP %s', event)
]:
	i: 369&385&401(f)
	o: 508(JA)

nname: 420
n 420(None)[ts = time() + 0.20000000000000001
event.post(dict(count=1, timeout=ts))
self._last_event = event
self._last_ts = ts
]:
	i: 369&385&401(t)
	o: 508(JA)

nname: 369&385&401
n 369&385&401(self._last_event is None or event != self._last_event or time() > self._last_ts)[]:
	i: 363(t)
	o: 420(t), 483(f)

nname: 363
n 363(event)[]:
	i: 162(JA), 214(), 266()
	o: 369&385&401(t), 508(f)

nname: 266
n 266(None)[if self.mouse.bl:
	event = self.kbmap_get('ENTER')
else:
	if self.mouse.br:
		event = self.kbmap_get('SMALL_A')
	else:
		if self.mouse.bm:
			event = self.kbmap_get('SMALL_H')
]:
	i: 41&124(f)
	o: 363()

nname: 214
n 214(None)[if vec[1] > 0:
	pass
event = self.kbmap_get('CURSOR_DOWN')
]:
	i: 141(f)
	o: 363()

nname: 162
n 162(None)[if vec[0] > 0:
	pass
event = self.kbmap_get('CURSOR_LEFT')
]:
	i: 141(t)
	o: 363(JA)

nname: 141
n 141(abs_vec[0] > abs_vec[1])[]:
	i: 41&124(t)
	o: 162(t), 214(f)

nname: 41&124
n 41&124(abs_vec[0] > threshold or abs_vec[1] > threshold)[log.debug(self.mouse)
vec = self.mouse.lastvector
abs_vec = (abs(vec[0]), abs(vec[1]))
event = None
]:
	i: 22(t)
	o: 141(t), 266(f)

nname: 22
n 22(self.mouse.get())[try:
	pass
]:
	i: 16(t)
	o: 41&124(t), 508(f), 512()

nname: 16
n 16(True)[]:
	i: 0(loop)
	o: 22(t), 554(f)

nname: 0
n 0(None)[log.debug('start')
]:
	i: 
	o: 16(loop), 554(AL)

nname: 554
n 554(None)[return None
]:
	i: 0(AL), 16(f), 512(AE)
	o: 

nname: 512
n 512(None)[except Exception, e:
	log.error('Error while calling Mouse.get(): %s', e)
	continue
]:
	i: 508(), 22()
	o: 554(AE)

nname: 508
n 508(None)[continue
]:
	i: 41&124(f), 22(f)
	o: 512()

nname: 41&124
n 41&124(None)[log.debug(self.mouse)
vec = self.mouse.lastvector
abs_vec = (abs(vec[0]), abs(vec[1]))
event = None
if abs_vec[0] > threshold or abs_vec[1] > threshold:
	if abs_vec[0] > abs_vec[1]:
		if vec[0] > 0:
			pass
		event = self.kbmap_get('CURSOR_LEFT')
	else:
		if vec[1] > 0:
			pass
		event = self.kbmap_get('CURSOR_DOWN')
else:
	if self.mouse.bl:
		event = self.kbmap_get('ENTER')
	else:
		if self.mouse.br:
			event = self.kbmap_get('SMALL_A')
		else:
			if self.mouse.bm:
				event = self.kbmap_get('SMALL_H')
if event:
	if self._last_event is None or event != self._last_event or time() > self._last_ts:
		ts = time() + 0.20000000000000001
		event.post(dict(count=1, timeout=ts))
		self._last_event = event
		self._last_ts = ts
	else:
		log.debug('DROP %s', event)
]:
	i: 22(t)
	o: 508(JA)

nname: 22
n 22(self.mouse.get())[try:
	pass
]:
	i: 16(t)
	o: 41&124(t), 508(f), 512()

nname: 16
n 16(True)[]:
	i: 0(loop)
	o: 22(t), 554(f)

nname: 0
n 0(None)[log.debug('start')
]:
	i: 
	o: 16(loop), 554(AL)

nname: 554
n 554(None)[return None
]:
	i: 0(AL), 16(f), 512(AE)
	o: 

nname: 512
n 512(None)[except Exception, e:
	log.error('Error while calling Mouse.get(): %s', e)
	continue
]:
	i: 22()
	o: 554(AE)

nname: 22
n 22(None)[try:
	pass
if self.mouse.get():
	log.debug(self.mouse)
	vec = self.mouse.lastvector
	abs_vec = (abs(vec[0]), abs(vec[1]))
	event = None
	if abs_vec[0] > threshold or abs_vec[1] > threshold:
		if abs_vec[0] > abs_vec[1]:
			if vec[0] > 0:
				pass
			event = self.kbmap_get('CURSOR_LEFT')
		else:
			if vec[1] > 0:
				pass
			event = self.kbmap_get('CURSOR_DOWN')
	else:
		if self.mouse.bl:
			event = self.kbmap_get('ENTER')
		else:
			if self.mouse.br:
				event = self.kbmap_get('SMALL_A')
			else:
				if self.mouse.bm:
					event = self.kbmap_get('SMALL_H')
	if event:
		if self._last_event is None or event != self._last_event or time() > self._last_ts:
			ts = time() + 0.20000000000000001
			event.post(dict(count=1, timeout=ts))
			self._last_event = event
			self._last_ts = ts
		else:
			log.debug('DROP %s', event)
continue
]:
	i: 16(t)
	o: 512()

nname: 16
n 16(True)[]:
	i: 0(loop)
	o: 22(t), 554(f)

nname: 0
n 0(None)[log.debug('start')
]:
	i: 
	o: 16(loop), 554(AL)

nname: 554
n 554(None)[return None
]:
	i: 0(AL), 16(f), 22(AE)
	o: 

nname: 22
n 22(None)[try:
	pass
if self.mouse.get():
	log.debug(self.mouse)
	vec = self.mouse.lastvector
	abs_vec = (abs(vec[0]), abs(vec[1]))
	event = None
	if abs_vec[0] > threshold or abs_vec[1] > threshold:
		if abs_vec[0] > abs_vec[1]:
			if vec[0] > 0:
				pass
			event = self.kbmap_get('CURSOR_LEFT')
		else:
			if vec[1] > 0:
				pass
			event = self.kbmap_get('CURSOR_DOWN')
	else:
		if self.mouse.bl:
			event = self.kbmap_get('ENTER')
		else:
			if self.mouse.br:
				event = self.kbmap_get('SMALL_A')
			else:
				if self.mouse.bm:
					event = self.kbmap_get('SMALL_H')
	if event:
		if self._last_event is None or event != self._last_event or time() > self._last_ts:
			ts = time() + 0.20000000000000001
			event.post(dict(count=1, timeout=ts))
			self._last_event = event
			self._last_ts = ts
		else:
			log.debug('DROP %s', event)
continue
except Exception, e:
	log.error('Error while calling Mouse.get(): %s', e)
	continue
]:
	i: 16(t)
	o: 554(AE)

nname: 16
n 16(True)[]:
	i: 0(loop)
	o: 22(t), 554(f)

nname: 0
n 0(None)[log.debug('start')
]:
	i: 
	o: 16(loop), 554(AL)

nname: 554
n 554(None)[return None
]:
	i: 22(AE)
	o: 

nname: 22
n 22(None)[	try:
		pass
	if self.mouse.get():
		log.debug(self.mouse)
		vec = self.mouse.lastvector
		abs_vec = (abs(vec[0]), abs(vec[1]))
		event = None
		if abs_vec[0] > threshold or abs_vec[1] > threshold:
			if abs_vec[0] > abs_vec[1]:
				if vec[0] > 0:
					pass
				event = self.kbmap_get('CURSOR_LEFT')
			else:
				if vec[1] > 0:
					pass
				event = self.kbmap_get('CURSOR_DOWN')
		else:
			if self.mouse.bl:
				event = self.kbmap_get('ENTER')
			else:
				if self.mouse.br:
					event = self.kbmap_get('SMALL_A')
				else:
					if self.mouse.bm:
						event = self.kbmap_get('SMALL_H')
		if event:
			if self._last_event is None or event != self._last_event or time() > self._last_ts:
				ts = time() + 0.20000000000000001
				event.post(dict(count=1, timeout=ts))
				self._last_event = event
				self._last_ts = ts
			else:
				log.debug('DROP %s', event)
	continue
	except Exception, e:
		log.error('Error while calling Mouse.get(): %s', e)
		continue
]:
	i: 0(t)
	o: 554(AE)

nname: 0
n 0(True)[log.debug('start')
while True:
]:
	i: 
	o: 22(t)

nname: 554
n 554(None)[return None
]:
	i: 0(AE)
	o: 

nname: 0
n 0(None)[log.debug('start')
while True:
	try:
		pass
	if self.mouse.get():
		log.debug(self.mouse)
		vec = self.mouse.lastvector
		abs_vec = (abs(vec[0]), abs(vec[1]))
		event = None
		if abs_vec[0] > threshold or abs_vec[1] > threshold:
			if abs_vec[0] > abs_vec[1]:
				if vec[0] > 0:
					pass
				event = self.kbmap_get('CURSOR_LEFT')
			else:
				if vec[1] > 0:
					pass
				event = self.kbmap_get('CURSOR_DOWN')
		else:
			if self.mouse.bl:
				event = self.kbmap_get('ENTER')
			else:
				if self.mouse.br:
					event = self.kbmap_get('SMALL_A')
				else:
					if self.mouse.bm:
						event = self.kbmap_get('SMALL_H')
		if event:
			if self._last_event is None or event != self._last_event or time() > self._last_ts:
				ts = time() + 0.20000000000000001
				event.post(dict(count=1, timeout=ts))
				self._last_event = event
				self._last_ts = ts
			else:
				log.debug('DROP %s', event)
	continue
	except Exception, e:
		log.error('Error while calling Mouse.get(): %s', e)
		continue
]:
	i: 
	o: 554(AE)

self.nodes: {0: <unpyclib.structure.node instance at 0xb761f6ec>, 554: <unpyclib.structure.node instance at 0xb761fe2c>}
nname: 6
n 6(None)[__doc__ = '\n    Plugin for mouse control.\n    '
def __init__(self, *args):
	threading.Thread.__init__(self)
	try:
		self.mouse = Mouse()
		self._last_event = None
		self._last_ts = 0
		log.info('Mouse created')
	except:
		log.error('Cannot open mouse')
		del self.mouse
	else:
		self.kbmap_get = DIRECTFB_MAP.get
		self.setDaemon(True)
		self.setName('MousePlugin')
		Task(self.start).start(1.0)
	return None

def run(self):
	log.debug('start')
	while True:
		try:
			pass
		if self.mouse.get():
			log.debug(self.mouse)
			vec = self.mouse.lastvector
			abs_vec = (abs(vec[0]), abs(vec[1]))
			event = None
			if abs_vec[0] > threshold or abs_vec[1] > threshold:
				if abs_vec[0] > abs_vec[1]:
					if vec[0] > 0:
						pass
					event = self.kbmap_get('CURSOR_LEFT')
				else:
					if vec[1] > 0:
						pass
					event = self.kbmap_get('CURSOR_DOWN')
			else:
				if self.mouse.bl:
					event = self.kbmap_get('ENTER')
				else:
					if self.mouse.br:
						event = self.kbmap_get('SMALL_A')
					else:
						if self.mouse.bm:
							event = self.kbmap_get('SMALL_H')
			if event:
				if self._last_event is None or event != self._last_event or time() > self._last_ts:
					ts = time() + 0.20000000000000001
					event.post(dict(count=1, timeout=ts))
					self._last_event = event
					self._last_ts = ts
				else:
					log.debug('DROP %s', event)
		continue
		except Exception, e:
			log.error('Error while calling Mouse.get(): %s', e)
			continue

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75ff20c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.notifier import Task
from peewee.gettime import time
from peewee.debug import GET_LOGGER
from Queue import Full
from pygui.input import DIRECTFB_MAP
from pygui.facilities.mouse import Mouse
from time import sleep
import threading
log = GET_LOGGER(__name__)
threshold = 2
class PluginInterface(.):
	__doc__ = '\n    Plugin for mouse control.\n    '
	def __init__(self, *args):
		threading.Thread.__init__(self)
		try:
			self.mouse = Mouse()
			self._last_event = None
			self._last_ts = 0
			log.info('Mouse created')
		except:
			log.error('Cannot open mouse')
			del self.mouse
		else:
			self.kbmap_get = DIRECTFB_MAP.get
			self.setDaemon(True)
			self.setName('MousePlugin')
			Task(self.start).start(1.0)
		return None

	def run(self):
		log.debug('start')
		while True:
			try:
				pass
			if self.mouse.get():
				log.debug(self.mouse)
				vec = self.mouse.lastvector
				abs_vec = (abs(vec[0]), abs(vec[1]))
				event = None
				if abs_vec[0] > threshold or abs_vec[1] > threshold:
					if abs_vec[0] > abs_vec[1]:
						if vec[0] > 0:
							pass
						event = self.kbmap_get('CURSOR_LEFT')
					else:
						if vec[1] > 0:
							pass
						event = self.kbmap_get('CURSOR_DOWN')
				else:
					if self.mouse.bl:
						event = self.kbmap_get('ENTER')
					else:
						if self.mouse.br:
							event = self.kbmap_get('SMALL_A')
						else:
							if self.mouse.bm:
								event = self.kbmap_get('SMALL_H')
				if event:
					if self._last_event is None or event != self._last_event or time() > self._last_ts:
						ts = time() + 0.20000000000000001
						event.post(dict(count=1, timeout=ts))
						self._last_event = event
						self._last_ts = ts
					else:
						log.debug('DROP %s', event)
			continue
			except Exception, e:
				log.error('Error while calling Mouse.get(): %s', e)
				continue



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75f864c>}
from __future__ import absolute_import
from peewee.notifier import Task
from peewee.gettime import time
from peewee.debug import GET_LOGGER
from Queue import Full
from pygui.input import DIRECTFB_MAP
from pygui.facilities.mouse import Mouse
from time import sleep
import threading
log = GET_LOGGER(__name__)
threshold = 2
class PluginInterface(.):
	__doc__ = '\n    Plugin for mouse control.\n    '
	def __init__(self, *args):
		threading.Thread.__init__(self)
		try:
			self.mouse = Mouse()
			self._last_event = None
			self._last_ts = 0
			log.info('Mouse created')
		except:
			log.error('Cannot open mouse')
			del self.mouse
		else:
			self.kbmap_get = DIRECTFB_MAP.get
			self.setDaemon(True)
			self.setName('MousePlugin')
			Task(self.start).start(1.0)
		return None

	def run(self):
		log.debug('start')
		while True:
			try:
				pass
			if self.mouse.get():
				log.debug(self.mouse)
				vec = self.mouse.lastvector
				abs_vec = (abs(vec[0]), abs(vec[1]))
				event = None
				if abs_vec[0] > threshold or abs_vec[1] > threshold:
					if abs_vec[0] > abs_vec[1]:
						if vec[0] > 0:
							pass
						event = self.kbmap_get('CURSOR_LEFT')
					else:
						if vec[1] > 0:
							pass
						event = self.kbmap_get('CURSOR_DOWN')
				else:
					if self.mouse.bl:
						event = self.kbmap_get('ENTER')
					else:
						if self.mouse.br:
							event = self.kbmap_get('SMALL_A')
						else:
							if self.mouse.bm:
								event = self.kbmap_get('SMALL_H')
				if event:
					if self._last_event is None or event != self._last_event or time() > self._last_ts:
						ts = time() + 0.20000000000000001
						event.post(dict(count=1, timeout=ts))
						self._last_event = event
						self._last_ts = ts
					else:
						log.debug('DROP %s', event)
			continue
			except Exception, e:
				log.error('Error while calling Mouse.get(): %s', e)
				continue



